package parser.nodes;

// Print = 'PRINT' Expression

import codegen.CodeGen;

public class PrintNode extends Node {

    private ExpressionNode expr;

    public PrintNode(ExpressionNode expr) {
        this.expr = expr;
    }

    @Override
    public void print() {
        p("Print:");
        indent();
        p("PRINT");
        expr.print();
        unindent();
    }

    @Override
    public void abstractPrint() {
        p("PRINT");
        indent();
        expr.abstractPrint();
        unindent();
    }

    @Override
    public void compile(CodeGen c) throws CompileError {
        expr.compile(c);
        c.outstr("PRINT");
    }
    
    
}
